package com.doit.day04

import scala.io.Source

object WordCount {
  def main(args: Array[String]): Unit = {
    Source.fromFile("data/word.txt")
      .getLines()
      .toList
      .flatMap(_.split(","))
      .groupBy(word => word)
      .map(tp => {
        (tp._1, tp._2.size)
      })
      .foreach(println)
  }
}
